package com.example.dell.fastshopping.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by ${YSH} on 2019/4/18.
 * 描述        ${TODO}
 * <p>
 * 更新者       $author$
 * 更新时间     $Data$
 * 描述         ${TODO}
 */
public class MatchesUtils {
    public static boolean isMobile(String mobiles) {
        Pattern p = Pattern.compile("^((13[0-9])|(15[^4,\\D])|(18[0-9])|(14[5,7])| (17[0,1,3,5-8]))\\d{8}$");
        Matcher m = p.matcher(mobiles);
        return m.matches();
    }

    public static boolean isMatches(String str) {
        String regex = "^.*[(/) | (\\\\) | (:) | (\\*) | (\\?) | (\") | (<) | (>)].*$";
        return str.isEmpty() || str.matches(regex) || str.length() < 4;

    }
}
